<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>注册</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="/home/css/amazeui.css" />
    <link href="/home/css/dlstyle.css" rel="stylesheet" type="text/css">
</head>

<body>

<div class="login-boxtitle">
    <a href="home.html"><img alt="logo" src="/home/picture/logobig.png" /></a>
</div>

<div class="login-banner">
    <div class="login-main">
        <div class="login-banner-bg"><span></span><img src="/home/picture/big.jpg" /></div>
        <div class="login-box">

            <h3 class="title">用户注册</h3>

            <div class="clear"></div>
            <form id="regform">
                <div class="login-form">

                    <div class="user-name">
                        <label><i class="am-icon-user"></i></label>
                        <input type="text" name="username" placeholder="用户昵称">
                    </div>

                    <div class="user-name">
                        <label><i class="am-icon-user"></i></label>
                        <input type="text" name="phone" placeholder="手机号码">
                    </div>
                    <div class="user-pass">
                        <label><i class="am-icon-lock"></i></label>
                        <input type="password" name="password" placeholder="登录密码">
                    </div>
                    <div class="user-pass">
                        <label><i class="am-icon-lock"></i></label>
                        <input type="password" name="password" placeholder="确认密码">
                    </div>

                </div>

                <div class="login-links">
                    <!--<label for="remember-me"><input id="remember-me" type="checkbox">记住密码</label>-->
                    <a href="{:url('index')}" class="zcnext am-fr am-btn-default">登录</a>
                </div>
                <div class="am-cf">
                    <!--<button  class="am-btn am-btn-primary am-btn-sm login">登 录</button>-->
                    <input type="submit" value="注 册" class="am-btn am-btn-primary am-btn-sm">
                </div>
            </form>
        </div>
    </div>
</div>
{include file="common/footer" /}
<script src="/home/js/jquery-1.7.2.min.js"></script>
<script src="/home/layer/2.4/layer.js"></script>
<script>
    $("#regform").submit(function(e){
        var res = $(this).serialize();
        // console.log(res)
        var url = "{:url('sign')}";
        $.ajax({
            url:  url,
            data: res,
            type: 'post',
            success:function(data){
                if (data.code == 0) {
                    layer.alert(data.msg,{icon:6},function (index) {
                        layer.close(index);
                        window.location.href = "{:url('user/index')}";
                    });
                } else{
                    layer.alert(data.msg,{icon:5},function (index) {
                        layer.close(index);
                    });
                }
            }
        });
        return false; // 阻止表单跳转
    });
</script>
</body>
</html>